package org.lgiavedoni.android.franq.util.implementation;

import java.util.HashMap;
import java.util.Map;

import org.lgiavedoni.android.franq.service.log.Logger;

public class Implementation {
	private final String clazz;
	private final Map<String, String> properties = new HashMap<String, String>();

	public Implementation(String clazz) {
		this.clazz = clazz;
	}

	public String getClazzName() {
		return clazz;
	}

	public Class getClazz() {
		try {
			return Class.forName(clazz);
		} catch (Throwable e) {
			Logger.inst.error(e);
			return null;
		}
	}

	public void addProperty(String key, String value) {
		properties.put(key, value);
	}

	public Map<String, String> getProperties() {
		return properties;
	}

	@Override
	public boolean equals(Object paramObject) {

		return paramObject instanceof Implementation ? clazz.equals(((Implementation) paramObject).getClazz()) : false;
	}

}
